﻿<%@ Page Title="admin_user" Language="C#" MasterPageFile="~/main/masterpage/main_level1.Master"
    AutoEventWireup="True" CodeBehind="user.aspx.cs" Inherits="nkstdgia.main.membership.user" %>

<%@ Register Assembly="wsRK.wsControls" Namespace="wsRK.wsControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phd_content" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="webapplication_form_header">
                <div class="left">
                    <h1>
                        <asp:Label ID="lblListUser" runat="server"><%= base.getValueFromLocale("ListOfUser")%></asp:Label>
                    </h1>
                </div>
                <div class="right">
                    <asp:Literal ID="litResult" runat="server"></asp:Literal>
                </div>
            </div>
            <div class="action_bar">
                <div class="right ">
                    <cc1:wsBtnAction ID="btnAdd" runat="server" LocaleText="CreateNewUser" ButtonType="ButtonAdd"
                        OnClick="lbtnAddUser_Click"></cc1:wsBtnAction>
                </div>
            </div>
            <asp:ListView ID="lvUserList" runat="server" OnItemCommand="lvUserList_ItemCommand"
                OnItemDataBound="lvUserList_ItemDataBound">
                <ItemTemplate>
                    <tr>
                        <td style="display: none">
                            <asp:Label ID="userId" runat="server" Text='<%# Eval("UserId") %>' />
                        </td>
                        <td>
                            <asp:HyperLink ID="UsernameLabel" runat="server" Text='<%# Eval("Username") %>' NavigateUrl='#'></asp:HyperLink>
                        </td>
                        <td>
                            <a href="mailto:<%# Eval("Email") %>">
                                <%# Eval("Email") %></a>
                        </td>
                        <td>
                            <asp:Label ID="RolesLabel" runat="server" Text='<%# Eval("Roles") %>' />
                        </td>
                        <td>
                            <asp:Label ID="LastActivityDateLabel" runat="server" Text='<%# Eval("LastActivityDate") %>' />
                        </td>
                        <td>
                            <asp:CheckBox ID="StatusCbx" runat="server" Checked='<%# bool.Parse(Eval("Status").ToString()) %>'
                                OnCheckedChanged="Active_Inactive_CheckedChanged" AutoPostBack="true" />
                            <asp:Label ID="UsrID" runat="server" Text='<%# Eval("UserId") %>' Visible="false" />
                        </td>
                        <td>
                            <asp:LinkButton ID="btnReset_Password" CssClass="button_submit" runat="server" Text="Reset Password"
                                CommandArgument='<%# Eval("UserId") %>' OnClick="Reset_Password_Click"></asp:LinkButton>
                            <asp:LinkButton ID="btnDeleteUser" CssClass="button_submit" runat="server" Text="Xóa"
                                CommandName="DeleteUser" CommandArgument='<%# Eval("UserId") %>' OnClientClick="javascript: return confirm('Bạn có chắc muốn xóa?');"></asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>
                <EmptyDataTemplate>
                    <label runat="server"><%= base.getValueFromLocale("NoData")%></label>
                </EmptyDataTemplate>
                <LayoutTemplate>
                    <table class="data_table">
                        <tr>
                            <th style="display: none" runat="server">
                                UserId
                            </th>
                            <th runat="server">
                                <%= base.getValueFromLocale("Username")%>
                            </th>
                            <th runat="server">
                                <%= base.getValueFromLocale("Email")%>
                            </th>
                            <th runat="server">
                                <%= base.getValueFromLocale("Role")%>
                            </th>
                            <th runat="server">
                                <%= base.getValueFromLocale("LastActivityDate")%>
                            </th>
                            <th runat="server">
                                <%= base.getValueFromLocale("Active")%>
                            </th>
                            <th>
                            </th>
                        </tr>
                        <tr id="itemPlaceholder" runat="server">
                        </tr>
                    </table>
                </LayoutTemplate>
            </asp:ListView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
